//----------------------------------------------------------
// Graphics_GameDX.h
//   Game-specific declaration of abstract Graphics class
//   DirectX support
//----------------------------------------------------------

#ifndef _GRAPHICS_GAMEDX_H_
#define _GRAPHICS_GAMEDX_H_

#include <windows.h>
#include <d3d9.h>
#include <d3dx9.h>
#include "Graphics.h"

class Graphics_GameDX : public Graphics 
{
private:
	Engine* _engine;
	LPDIRECT3D9 _pD3D;
	LPDIRECT3DDEVICE9 _pD3DDevice;
	HWND* _wndHandle;

	// Camera vectors
	D3DXVECTOR3* _pvCamPos;	// position vector
	D3DXVECTOR3* _pvCamLook;	// look vector
	D3DXVECTOR3* _pvCamUp;	// up vector

public:
	Graphics_GameDX();
	~Graphics_GameDX();

	// housekeeping
	bool Initialize(Engine* pEngine);
	bool Update(float deltaTime);
	bool Shutdown();

	bool RenderStart();
	void RenderEnd();

	// general D3D variables
	LPDIRECT3DVERTEXBUFFER9 lpvBuffer;		// pointer to the vertex buffer
	LPDIRECT3DINDEXBUFFER9	lpiBuffer;		// pointer to the index buffer
	LPDIRECT3DSURFACE9		lpzbuffer;		// pointer to the z-buffer
	LPDIRECT3DTEXTURE9		texture;		// current texture
	LPD3DXMESH				meshCustom;		// pointer for custom mesh
	D3DMATERIAL9*			material;		// material object
	DWORD					numMaterials;	// number of materials in the current mesh
	LPD3DXBUFFER			bufCustomX;		// ?
	D3DXMATRIX				matView;		// view transform matix

	// get functions
	LPDIRECT3DDEVICE9	GetD3DDevice() { return _pD3DDevice; }
	D3DXVECTOR3*		GetCameraPos() { return _pvCamPos; }

};

#endif